package menuaction;

import java.awt.BorderLayout;
import java.awt.Dialog;

import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SpringLayout;

import main.Application;
import main.SpringUtilities;
import menu.ExceptionCatcher;
import controls.EnumDropDownList;

public class ZboonSickExperimentsWithSwingMenuAction extends ExceptionCatcher{
	
	private JDialog dialog;

	@Override
	public void runMenuAction() {
		dialog = new JDialog(Application.getInstance().getFrame(), "okienko do psucia", Dialog.ModalityType.APPLICATION_MODAL);
		dialog.setLayout(new BorderLayout());
		JPanel upychacz = new JPanel();
		JPanel klocekPanel = new JPanel();

		klocekPanel.setLayout(new SpringLayout());
		String[] dupy = {"dupa1", "dupa2", "dupa3"};
		
		klocekPanel.add(new JLabel("label1"));
		klocekPanel.add(new EnumDropDownList(dupy));
		klocekPanel.add(new JLabel("label2"));
		klocekPanel.add(new JLabel("label3"));
		klocekPanel.add(new JLabel("label4"));
		klocekPanel.add(new JLabel("label5"));
		SpringUtilities.makeCompactGrid(klocekPanel, 3, 2,  //rows, columns
												7, 7,  //initialX, initialY
												7, 7); //xPad, yPad
		
		dialog.add(klocekPanel, BorderLayout.NORTH);
		dialog.add(upychacz, BorderLayout.CENTER);
		
		dialog.setSize(250, 160);
		dialog.setLocation(300, 300);
		dialog.setVisible(true);
		
	}
}
